package com.xl.basic.enums;

import cn.hutool.core.util.StrUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.experimental.Accessors;

import java.util.Arrays;

/**
 * 基础菜单枚举
 *
 * @author 钟勇
 * Create in 2023/8/30 10:08
 */
@Getter
@AllArgsConstructor
@Accessors(chain = true)
public enum BasicRoleEnums {
    developer("developer", "系统开发者"),
    pub("public", "公开菜单"),
    ;
    private final String menuSign;
    private final String menuTitle;

    public static BasicRoleEnums getByMenuSign(String menuSign) {
        if (StrUtil.isBlank(menuSign)) {
            return null;
        }

        return Arrays.stream(values())
                .filter(item -> item.getMenuSign().equals(menuSign))
                .findFirst().orElse(null);

    }
}
